USE [Monitoring]
GO

--|--------------------------------------------------------------------------------
--| [GetEntityTypeByID] - Insert Procedure Script for EntityType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[GetEntityTypeByID]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
  DROP PROCEDURE [dbo].[GetEntityTypeByID]
GO

/*CREATE PROCEDURE [dbo].[GetEntityTypeByID]
(
	@ID int
)
AS
	SET NOCOUNT ON

	SELECT
		[ID],
		[Name]
	FROM 
EntityType
	WHERE
		[ID] = @ID
	
GO*/


--|--------------------------------------------------------------------------------
--| [InsertEntityType] - Insert Procedure Script for EntityType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[InsertEntityType]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
  DROP PROCEDURE [dbo].[InsertEntityType]
GO

/*CREATE PROCEDURE [dbo].[InsertEntityType]
(
	@ID int,
	@Name nvarchar(50)
)
AS
	SET NOCOUNT ON

	INSERT INTO [EntityType]
	(
		[ID],
		[Name]
	)
	VALUES
	(
		@ID,
		@Name
	)

	RETURN @@Error
GO*/

--|--------------------------------------------------------------------------------
--| [UpdateEntityType] - Update Procedure Script for EntityType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[UpdateEntityType]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
	DROP PROCEDURE [dbo].[UpdateEntityType]
GO

/*CREATE PROCEDURE [dbo].[UpdateEntityType]
(
	@ID int,
	@Name nvarchar(50)
)
AS
	SET NOCOUNT ON
	
	UPDATE [EntityType]
	SET
		[ID] = @ID,
		[Name] = @Name
	WHERE 
		[ID] = @ID

	RETURN @@Error
GO*/

--|--------------------------------------------------------------------------------
--| [DeleteEntityType] - Update Procedure Script for EntityType
--|--------------------------------------------------------------------------------
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id (N'[dbo].[DeleteEntityType]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) 
	DROP PROCEDURE [dbo].[DeleteEntityType]
GO

/*CREATE PROCEDURE [dbo].[DeleteEntityType]
(
	@ID int
)
AS
	SET NOCOUNT ON

	DELETE 
	FROM   [EntityType]
	WHERE  
		[ID] = @ID

	RETURN @@Error
GO*/

